$(document).ready(function() {
	$('#registerButton').click(function() {
		$.post('/register',$('#registrationForm').serialize(), function(response) {
			if(response.alreadyExists){
				alert('User is already registered, try a different email address');
			}
			if(response.successful){
				alert('You have successfully registered');
			}
			if(response.failed){
				alert(response.comment);
			}
		});
	});
});